package cc.ttiot.enums;

import cc.ttiot.utils.*;

/**
 * @Description: 传感器常量
 * @Author WangSuheng
 * @Date 2021/10/3 18:09
 * @Version 1.0
 */
public class SystemConstant {
    //程序中禁止修改以下常量或对象内部的值

    /**
     * 防护门常量
     */
    public static final long DOOR_ID = StringUtils.getDoorId();
    public static final int[] USED_SENSORS = StringUtils.getSensorId();

//-----------------------------------------------------------------------------------------

    /**
     * 传感器常量
     */

    // (1)接近开关
    public static final int CLOSE = 0;
    public static final int OPEN = 1;

//-----------------------------------------------------------------------------------------

    /**
     * MQTT连接信息
     */
    public static final String APPROACHING_SWITCH_TOPIC = "ApproachingSwitchMsg";
    public static final String TEMPERATURE_AND_HUMIDITY_TOPIC = "TemperatureAndHumidityMsg";
    public static final String VIBRATION_TOPIC = "VibrationMsg";
    public static final String WIND_PRESSURE_TOPIC = "WindPressureMsg";
    public static final String CAMERA = "Camera";

    public static final String BROKER = PropertiesUtils.getProperty("broker");
    public static final String MQTT_USER_NAME = PropertiesUtils.getProperty("mqttUserName");
    public static final String MQTT_PASSWORD = PropertiesUtils.getProperty("mqttPassword");

    /**
     * 主要用于PUBLISH（发布态）消息的，保证消息传递的次数
     * 0表示最多一次,即<=1
     * 1表示至少一次,即>=1
     * 2表示一次,即==1
     * default = 1
     */
    public static final int QOS = 1;
}
